<template>
  <div class="main">
    <!-- <div v-if="!nickName=='若依--超级管理员'||nickName==''">
    <header class="top">
      <avatar v-if="checkRole(['admin', 'newMediaUser', 'contentUser', 'operateUser','examine'])">
      </avatar>
      <avatarFull v-if="checkRole(['admin', 'ordinaryUser'])"></avatarFull>
    </header>
    <main class="content">
      <step  v-if="checkRole(['admin', 'ordinaryUser','contentUser','operateUser'])"></step>
      <MediaStep v-if="checkRole(['admin', 'newMediaUser','examine'])"></MediaStep>
    </main>
   </div> -->
    <div>
      <header class="top" v-if="Moro">
        <!-- <avatar v-if="checkRole(['admin', 'newMediaUser', 'contentUser', 'operateUser', 'examine'])">
        </avatar> -->
        <!-- <avatarFull v-if="checkRole(['admin', 'ordinaryUser'])"></avatarFull> -->
        <avatarFull></avatarFull>
      </header>
      <main class="content">
        <step v-if="checkRole(['admin', 'ordinaryUser', 'contentUser', 'operateUser', 'common']) &&
        !['0', '2'].includes($store.state.user.info.examineStatus.toString())"></step>
        <MediaStep v-if="checkRole(['admin', 'newMediaUser', 'examine']) &&
        !['0', '2'].includes($store.state.user.info.examineStatus.toString())"></MediaStep>
        <div class="shenhe">
          <div v-if="['0'].includes($store.state.user.info.examineStatus.toString())"
            style="display: flex;align-items: center;">
            <div> <img :src="succ" alt="" srcset=""></div>
            <h1 style="font-size: 40px;">您的申请正在审核中</h1>
          </div>

          <div style="display: flex;align-items: center;flex-direction: column;"
            v-if="['2'].includes($store.state.user.info.examineStatus.toString())">
            <div style="display: flex;align-items: center;">
              <div> <img :src="fail" alt="" srcset=""></div>
              <div>
                <h1 style="font-size: 40px;">您的申请已驳回</h1>
              </div>
            </div>
            <h2 style="color: red;width: 475px;text-align:justify ;line-height: 37px;">
              驳回原因：{{ $store.state.user.info.examineFailReason }}
            </h2>
            <!-- <h3 v-if="$store.state.user.info.examineFailReason">{{ $store.state.user.info.examineFailReason }}</h3> -->
          </div>
        </div>
      </main>
      <!-- <MyImg></MyImg>
      <MyImg></MyImg> -->
    </div>

    <!-- <div class="shenhe" v-if="['0'].includes($store.state.user.info.examineStatus.toString())">
      <div><img :src="succ" alt="" srcset=""></div>
      <h1 style="font-size: 40px;">您的申请正在审核中</h1>
      <div><img :src="fail" alt="" srcset=""></div>
      <h1 style="font-size: 40px;">您的申请已驳回</h1>
    </div> -->


   <!-- <div class="" style="position: fixed; top: 50%; left: 50%; background: red; padding: 20px; color: aliceblue;" @click="goKePu">
      去科普创作
    </div> -->
  </div>
</template>

<script>
// import MyImg from '@/views/error/test'
import avatar from '@/views/components/avatar'
import avatarFull from '@/views/components/avatar/full'
import step from '@/views/components/step'
import MediaStep from '@/views/components/step/mediastep'
import { mapGetters, mapState, mapActions } from "vuex";
import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
import { getScanCodeAuthUrl, authenticationDataUser } from '@/api/my'
// import makerUser from './components/maker'

export default {
  components: { avatar, avatarFull, step, MediaStep },
  name: '',
  computed: {
    ...mapState(["settings"]),
    ...mapGetters(["sidebarRouters", "sidebar", "avatar", "name", "nickName"]),
    Moro() {
      if (this.$store.state.user.roles[0] == 'ordinaryUser') {
        return true
      }
      if (this.$store.state.user.roles[0] == 'admin' || this.$store.state.user.roles[0] == 'common') {
        return true
      }
      return false
    }
  },
  data() {
    return {
      succ: require('@/assets/images/succ.png'),
      fail: require('@/assets/images/fail.png'),
      isAuth: false
    }
  },
  created() {
    // this.GetInfo()
    // console.log(this.$store.state.user.info.examineStatus, 123);
    // if(user.examineStatus !== "1" && user.examineStatus !==undefined){
    //0 待审核 1已通过  2未通过 3待提交认证

    //v-if="['1', '2'].includes($store.state.user.info.examineStatus.toString())"

    // v-if="['0'].includes($store.state.user.info.examineStatus.toString())"

    // this.toAuth()
  },
  mounted() {
  },
  methods: {
    checkPermi,
    checkRole,
    ...mapActions(['GetInfo']),
    async toAuth() {  //新授权
      //console.log(this.$store.state.user.userId);
      let res = await getScanCodeAuthUrl(this.$store.state.user.userId)
      window.location.href = res.data;
      //  console.log(res);
      // alert(123)
      //http://sailzhang.free.idcfengye.com/openplatform/getAuthAccessToken&auth_type=3
      //  openplatform/getAuthAcessToken
    },

    goKePu() {
      // console.log(this.$store.state.user.info.examineStatus);
      this.$router.push({ path: '/kePuIndex' })
    },
  }
}
</script>

<style lang='scss' scoped>


.main {
  background-color: #F5F5F5;
  padding-right: 20px;
  padding-left: 20px;
  padding-top: 20px;

  .top {
    height: 170px;
    background: #FFFFFF;
    margin-bottom: 10px;
    border-radius: 10px;
    //margin-right: 20px;
  }

  .content {
    //margin-top: 10px;
    // background-color: #FFFFFF;
  }

  .shenhe {
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 180px;
    // height: 70vh;
  }
}
</style>
